import httpRequest from './request.js'
// 登陆app
function login(data, loading) {
	return httpRequest('/loginApp', 'get', data, loading);
}
// 发送短信验证码
function sendPhoneMsg(data, loading) {
	return httpRequest('/sendSms', 'get', data, loading);
}
// 根据userid获取用户信息
function getUserInfoByUserId(data, loading) {
	return httpRequest('/user/getUserById', 'get', data, loading);
}

// 查询商品列表
function getGoodList(data, loading) {
	return httpRequest('/goods/queryGoodsList', 'post', data, loading);
}
// 根据id获取物品详情
function getGoodsByGoodsId(data, loading) {
	return httpRequest('/goods/getGoodsByGoodsId', 'get', data, loading);
}
// 兑换商品校验积分
function checkOrderPoint(data,loading){
	return httpRequest('/order/checkOrder','get',data,loading);
}
// 创建订单
function addOrder(data,loading){
	return httpRequest('/order/addOrder','post',data,loading,'multiple');
}
// 根据订单id获取详情
function getOrdeDetail(data,loading){
	return httpRequest('/order/getOrderByOrderId','get',data,loading)
}
// 检查是否有审核的订单
function checkAuditStatus(data,loading){
	return httpRequest('/business/checkAuditStatus','get',data,loading);
}
// 商家入驻
function addBusiness(data,loading){
	return httpRequest('/business/addBusiness','post',data,loading);
}
// 商家入驻详情
function businessDetail(data,loading){
	return httpRequest('/business/queryBusinessByBusinessId','get',data,loading)
}
// 商家入驻列表
function businessList(data,loading){
	return httpRequest('/business/queryBusinessByUserId','get',data,loading);
}
// 获取用户积分
function getUserPoint(data,loading){
	return httpRequest('/user/getUserPoints','get',data,loading);
}
// 获取用户会员
function getCustomers(data,loading){
	return httpRequest('/user/getCustomers','get',data,loading);
}
// 修改会员信息
function updateCustomer(data,loading){
	return httpRequest('/customer/updateCustomer','post',data,loading);
}
// 获取用户商品订单
function getUserGoodOrder(data,loading){
	return httpRequest('/user/getGoodsOrders','get',data,loading);
}
// 查询三者险区域
function queryThreeRisks(data,loading){
	return httpRequest('/threeRisks/queryThreeRisks','post',data,loading);
}

// 创建会员
function addCustomer(data,loading){
	return httpRequest('/customer/pay','post',data,loading);
}
// 获取用户商品订单详情
function getUserGoodOrderDetail(data,loading){
	return httpRequest('/order/getOrderByOrderId','get',data,loading);
}

// 查看全部门店
function getShops(data,loading){
	return httpRequest('/business/getShops','get',data,loading);
}

// 获取会员详情
function getCustomerByCustomerId(data,loading){
	return httpRequest('/customer/getCustomerByCustomerId','get',data,loading);
}

// 检查是否绑定微信
function checkUserBindWX(data,loading){
	return httpRequest('/checkBindingWechat','post',data,loading)
}

// 更新用户信息
function updateUserInfo(data,loading){
	return httpRequest('/user/updateUser','post',data,loading)
}

// 支付成功回调
function payCallback(data,loading){
	return httpRequest('/customer/payCallback','get',data,loading)
}

// 注销账号
function cancelUser(data,loading){
	return httpRequest('/user/cancelUser','get',data,loading)
}




export default {
	login,
	sendPhoneMsg,
	getUserInfoByUserId,
	getGoodList,
	getGoodsByGoodsId,
	checkOrderPoint,
	addOrder,
	getOrdeDetail,
	checkAuditStatus,
	addBusiness,
	businessDetail,
	businessList,
	getUserPoint,
	getCustomers,
	getUserGoodOrder,
	queryThreeRisks,
	addCustomer,
	getUserGoodOrderDetail,
	getShops,
	getCustomerByCustomerId,
	updateCustomer,
	checkUserBindWX,
	updateUserInfo,
	payCallback,
	cancelUser
}
